<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="com.alibaba.fastjson.JSONArray" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/common/page_init.jsp" %>
<%
    JSONObject result = (JSONObject) request.getAttribute("result");
    JSONArray rows = result.getJSONArray("rows");
    int count = rows.size();
%>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title><%=CommonConfig.getString("SYSTEM_TITLE")%></title></head>
    <script type="text/javascript" src="<%=contextPath%>/js/console/config/configList.js?uuid=<%=RANDOM%>">
    </script>
    <script>
        var count = <%=count%>
    </script>
<body>
<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'north',border:false" style="height:38px;">
        <div class="title-bt">
            <span class="pl10">设置</span><span class="pr10 tr">
            </span>
        </div>
    </div>
    <div data-options="region:'center',border:false" style="background-color: #f8f8f8;align-items: center" >

        <div style="margin: 20px auto 10px auto;width: 600px;height: auto;">
            <div style="float: none">
            <span style="font-size: 15px">监控阀值</span>
            </div>
        </div>
        <div style="width: 600px;margin: 20px auto 10px auto;background-color: white;">
            <table style="width: 100%;height: auto; cellspacing: 0; cellpadding:0;">
                <%
                    if(rows.size()>0){
                        for(int i=0;i<rows.size();i++){
                            String configCode = rows.getJSONObject(i).getString("configCode");
                            String configName = rows.getJSONObject(i).getString("configName");
                            String configValue = rows.getJSONObject(i).getString("configValue");
                            String configDesc = rows.getJSONObject(i).getString("configDesc");
                            Integer configStatus = rows.getJSONObject(i).getInteger("configStatus");
                            int id = rows.getJSONObject(i).getIntValue("id");
                %>
                <tr style="height: 70px;">
                    <td class="hidden"><%=i%></td>
                    <td style="border-bottom: 2px solid #F4F4F4;width: 50%">
                        <span style=" padding-left: 20px;font-size: 13px" id="configName" name="configName"><%=configName%></span><br>
                        <span style=" padding-left: 20px;font-size: 12px;color: darkgray" id="configDesc" name="configDesc"><%=configDesc%></span>
                    </td>
                    <td style="border-bottom: 2px solid #F4F4F4;width: 40%;">
                        <input id="configValue" name= "configValue" style="width:200px;" class="easyui-slider" value="<%=configValue%>" data-options="showTip: true,
                                   tipFormatter: function (value) {
                                        return value + '%'}"/>
                    </td>
                    <td style="border-bottom: 2px solid #F4F4F4;width: 10%;" id="status">
                        <span class="hidden" id="id" class="id"><%=id%></span><br>
                        <span class="hidden" id="configCode" class="configCode"><%=configCode%></span><br>
                        <span class="hidden" id="configStatus" class="configStatus"><%=configStatus%></span><br>
                    </td>
                </tr>
                <%
                        }
                    }
                %>
            </table>
        </div>
</div>
</body>
</html>